using System;
using System.ComponentModel.DataAnnotations;

using Orchard;
using Orchard.ContentManagement.Records;
using Orchard.Data.Conventions;

namespace LuDC.CKEditor.Models
{
	public class CKEditorSettingsPartRecord : ContentPartRecord
	{
		public const string DefaultContentsCss = "Site.css";
		private string _contentsCss = DefaultContentsCss;
		public const string DefaultExtraPlugins = "medialibrary";
		private string _extraPlugins = DefaultExtraPlugins;
		public const bool DefaultClearDefaultStyleSets = false;
		private bool _clearDefaultStylesets = DefaultClearDefaultStyleSets;
		public const bool DefaultEnableAdvancedContentFilter = false;
		private bool _enableAdvancedContentFilter = DefaultEnableAdvancedContentFilter;
		public const string DefaultToolbar = @"
	['Source','-'/*,'Save','NewPage','Preview','-'*/,'Templates'],
    ['Cut','Copy','Paste','PasteText','PasteFromWord','-','Print', 'SpellChecker', 'Scayt'],
    ['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],
    ['Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton', 'HiddenField'],
    '/',
    ['Bold','Italic','Underline','Strike','-','Subscript','Superscript'],
    ['NumberedList','BulletedList','-','Outdent','Indent','Blockquote','CreateDiv'],
    ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],
    ['BidiLtr', 'BidiRtl' ],
    ['Link','Unlink','Anchor'],
    ['MediaLibrary', 'Image','Flash','Table','HorizontalRule','Smiley','SpecialChar','PageBreak','Iframe'],
    '/',
    ['Styles','Format','Font','FontSize'],
    ['TextColor','BGColor'],
    ['Maximize', 'ShowBlocks','-','About']
";
		private string _toolbar = DefaultToolbar;

		[StringLength(255)]
		public virtual String ContentsCss
		{
			get { return _contentsCss; }
			set { _contentsCss = value; }
		}

		[StringLength(1024)]
		public virtual string ExtraPlugins
		{
			get { return _extraPlugins; }
			set { _extraPlugins = value; }
		}

		public virtual bool ClearDefaultStyleSets
		{
			get { return _clearDefaultStylesets; }
			set { _clearDefaultStylesets = value; }
		}

		public virtual bool EnableAdvancedContentFilter
		{
			get { return _enableAdvancedContentFilter; }
			set { _enableAdvancedContentFilter = value; }
		}

		[StringLengthMax]
		public virtual string Toolbar
		{
			get { return _toolbar; }
			set { _toolbar = value; }
		}
	}
}